Purpose
The getTime task allows you to obtain a current timestamp for use in other tasks in a workflow. An offset may be applied to the current timestamp, if needed. The getTime task uses UTC for time representation.
Potential Use Case
Use this task if you need to post the current time in a logfile or external database when an automation is started or completed. Using an offsetDuration, you can also use this task to provide a future timestamp that can be calculated from the current timestamp.
Properties
| Incoming | Type | Description |
|---|---|---|
Timezone |
Enum | Required. The Timezone to use for getting the current time. |
offsetDuration |
Object | Optional. A duration to offset the current time expressed as an object literal notation. For example: {"days": 7,"months":1} will add 7 days and 1 month to the current system timestamp. Numeric values entered without any other designators will be treated as milliseconds (default). |
format |
String | Optional. Represents the format in which the converted timestamp should be displayed. Accepts formats identified in the moment.js documentation. Leaving this parameter blank will default the outgoing time parameter to the format of YYYY-MM-DDTHH:mm:ss.SSSSSSZZ. |
Note: If using object literal notations in the
offsetDurationproperty, you must include the curly braces in the value. See examples below. For more information regarding the object literal notation, see the moment.js documentation.
| Outgoing | Type | Description |
|---|---|---|
time |
Object | The new timestamp that is returned by the task. Presented in the format specified by the incoming format parameter. |
Examples
Example 1
In this IAP example:
The
Timezonevariable is set to UTC-04:00(North American Eastern Time).The
offsetDurationwill add 7 days and 1 month to theTimezonevalue that is retrieved.The
formatvariable is set toLLLL, which is the format for Month name, day of month, day of week, year, time.For this example, the new
timevalue produced upon output will be presented in theLLLLformat specified by the incomingformatvariable.
Example 2
In this IAP example:
The
Timezoneproperty is is set to UTC-04:00(North American Eastern Time).The
offsetDurationwill add 86400000 milliseconds (1 day) to theTimezonevalue that is retrieved.The
formatvariable is set toMMM-DD-YYYY, which is the format for Month-Day-Full Year.For this example, the new
timevalue produced upon output will be presented in theMMM-DD-YYYYformat specified by the incomingformatvariable.
Example 3
In this IAP example:
The
Timezonevariable is set to UTC-04:00(North American Eastern Time).The
offsetDurationwill add4 hoursto theTimezonevalue that is retrieved.The
formatvariable is set tohh:mm:ss, which is the format for Hours:Minutes:Seconds.For this example, the new
timevalue produced upon output will be presented in thehh:mm:ssformat specified by the incomingformatvariable.